package kr.hkit.androidcomplete01.chapter07;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.View;

public class CustomViewEx extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(new MyView(this));
	}
	
	class MyView extends View{
		Paint paint;
		public MyView(Context context) {
			super(context);
			paint = new Paint();
		}
		@Override
		protected void onDraw(Canvas canvas) {
			super.onDraw(canvas);
			canvas.drawColor(Color.LTGRAY);//canvas 전체에 밝은 회색을 색칠
			paint.setColor(Color.BLUE);		//붓을 파란색으로 설정
			canvas.drawCircle(100, 100, 80, paint);//canvas에 원(100,100)위치에 반지름이 80pixel인 원을 그림
			
			paint.setColor(Color.RED);
			canvas.drawCircle(300, 100, 80, paint);
		}
		
	}
}
